package com.czbank.financing.mapper;

import com.czbank.financing.Entity.Account;
import org.apache.ibatis.annotations.*;

import javax.annotation.Resource;
import java.util.List;

@Resource(name="indexMapper")
public interface AccountMapper {


    @Select("SELECT * FROM account")
    public List<Account> TotalAccount();

    @Select("SELECT * FROM account where id=#{id}")
    public Account selectAccountById(@Param("id") long id);

    @Update("updata account set uid=#{uid},balance=#{balance},registerTime=#{registerTime},cancellation=#{cancellation},creationtime=#{creationtime}")
     int updateAccount(@Param("account")Account account);

    @Insert("insert into account(uid,balance,,registerTime,cancellation,creationtime) values(#{uid},#{balance},#{registerTime},#{cancellation},#{creationtime})")
    int addAccount(@Param("account")Account account);

    @Delete("delete * FROM account where id=#{id}")
     int deleteAccount(@Param("id")long id);
}
